package com.chlp.core.framework.config;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 处理spring mvc java8日期转换问题
 * @author 陈礼鹏
 * @date 2020/1/16 17:23
 *
 * <dependency>
 * 	<groupId>com.fasterxml.jackson.core</groupId>
 * 	<artifactId>jackson-databind</artifactId>
 * 	<version>2.9.8</version>
 * </dependency>
 * <dependency>
 * 	<groupId>com.fasterxml.jackson.module</groupId>
 * 	<artifactId>jackson-module-parameter-names</artifactId>
 * 	<version>2.9.8</version>
 * </dependency>
 * <dependency>
 * 	<groupId>com.fasterxml.jackson.datatype</groupId>
 * 	<artifactId>jackson-datatype-jdk8</artifactId>
 * 	<version>2.9.8</version>
 * </dependency>
 * <dependency>
 * 	<groupId>com.fasterxml.jackson.datatype</groupId>
 * 	<artifactId>jackson-datatype-jsr310</artifactId>
 * 	<version>2.9.8</version>
 * </dependency>
 *
 */
@Configuration
public class JacksonConfig {

	@Bean
	public ObjectMapper serializingObjectMapper() {
		ObjectMapper objectMapper = new ObjectMapper();
		objectMapper.findAndRegisterModules();
		return objectMapper;
	}
}